<div class="starter-template" ng-show="ctrl.loading==true">
  Please wait, new user creation can take up to 30 seconds.
</div>
<div class="starter-template" ng-show="ctrl.scanning==false && ctrl.loading != true">
  <div class="row">
    <div class="col-sm-9 col-md-7 col-lg-5 mx-auto">
      <div class="card card-signin my-5">
        <div class="card-body">
          <h5 class="card-title text-center"><span translate lib="web">signin</span> {{ctrl.domain}}</h5>
          </h5>
          <form class="form-signin" ngNoForm method='post' action='/local'>
            <div class="form-label-group" ng-show="ctrl.localenabled">
              <input type="text" name="username" ng-model="ctrl.username" class="form-control" placeholder="email"
                required autofocus autocomplete='off' ng-change="ctrl.usernameblur()" ng-blur="ctrl.usernameblur()">
              <label for="username" translate lib="web">email</label>
            </div>
            <div class="form-label-group" ng-show="ctrl.localenabled" id="password">
              <input type="password" name="password" ng-model="ctrl.password" class="form-control"
                placeholder="Password" required>
              <label for="password" translate lib="web">password</label>
            </div>
            <div class="mb-3">
              <label class="text-danger" translate lib="web" ng-model="ctrl.message">{{ctrl.message}}</label>
            </div>
            <div id="localbuttons">
              <button class="btn btn-lg btn-primary btn-block text-uppercase" type="submit" ng-show="ctrl.localenabled"
              translate lib="web" ng-click="ctrl.loading = true">signin</button>
              <hr class="my-4"  ng-show="ctrl.localenabled && ctrl.forgot_pass_emails">
              <button class="btn btn-lg btn-primary btn-block text-uppercase" type="button" ng-show="ctrl.localenabled && ctrl.forgot_pass_emails"
              ng-click="ctrl.BeginForgotPassword()" 
              translate lib="web" ng-click="ctrl.loading = true">forgot password</button>
            </div>
            <hr class="my-4" ng-show="ctrl.localenabled">

            <a ng-href="/{{model.id}}" ng-repeat="model in ctrl.providers" class="btn btn-lg btn-block text-uppercase"
              ng-click="ctrl.loading = true">
              <em style="padding-right: 5px;" class="fab {{model.logo}} mr-2"></em><span translate lib="web">{{model.name}}</span>
            </a>

            <a href ng-click="ctrl.Scan()" ng-show="ctrl.qrcodescan" class="btn btn-lg btn-block text-uppercase">
              <em class="fas fa-qrcode mr-2"></em><span translate lib="web">QRCode Scan</span>
            </a>
            <div class="card-body" ng-show="ctrl.allow_user_registration==true">
              <small><em>
                  Select a provider or login using a local username and password.
                  A new user will automaticly be created if username is unknown.
                  Email validation will be requered to use the core functions.</em></small>
            </div>
          </form>
        </div>
      </div>
    </div>
  </div>
</div>
<div class="cameraView" ng-show="ctrl.scanning==true">
  <a href ng-click="ctrl.Scan()" ng-show="ctrl.scanning==true" class="btn btn-lg btn-block text-uppercase">
    <em class="fas fa-qrcode mr-2"></em><span translate lib="web">QRCode Scan</span>
</div>